
package test;

import java.io.IOException;

import jing.codegen.DeviceGenerator;
import jing.codegen.impl.DeviceGeneratorImpl;

public class DeviceToClazz {

    public static void main(String[] args) {

        do {
            if (args.length < 1) {
                System.out.println(String.format("%s url", DeviceToClazz.class.getSimpleName()));
                break;
            }

            String url = args[0];
            String folder = System.getProperty("user.dir");

            System.out.println(String.format("Parse url: %s", url));

            DeviceGenerator generator = new DeviceGeneratorImpl();
            
            try {
                generator.generate(folder, url);
            } catch (IOException e) {
                e.printStackTrace();
                break;
            }

            System.out.println(String.format("Device create ok"));


//
//            ClazzGenerator generator = new ClazzGenerator();
//            List<String> files = generator.generate(device, path);
//
//            if (files.size() == 0) {
//                System.out.println(String.format("generate Class File failed"));
//                break;
//            }
//
//            String names = "";
//            for (String file : files) {
//                names += file;
//                names += "  ";
//            }
//            System.out.println(String.format("generate Class Files ok: %s", names));

        } while (false);

        return;
    }
}
